package com.wn.www.carbeauty.controller;

import com.wn.www.carbeauty.service.IStoresService;
import com.wn.www.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chan
 * @since 2025-04-11
 */
@RestController
@RequestMapping("/stores")
public class StoresController {

    @Autowired
    private IStoresService storesService;

    @GetMapping("/{service_id}")
    public Result getStoresByServiceId(@PathVariable("service_id")Integer id){
        return Result.ok(storesService.storesListByServiceId(id));
    }

    @GetMapping("/{id}")
    public Result getStoresById(@PathVariable("id")Integer id){
        return Result.ok(storesService.storesById(id));
    }
}
